<?php
require_once('lib/db_connection.php');
$hids = $_GET["hids"];
$veh_id = $_GET["veh_id"];
/*if($hids!="")
{
 $or = '';
 $hids = explode(',',$hids);
 foreach($hids as $hid)
 {
  $or .= " OR autoid='".$hid."'";
 }
 if($or=='')
 $or = substr($or,4);
 $query_helpers= "SELECT * FROM employee_tbl WHERE job_title='Helper' AND company_id='".$_SESSION['company_id']."' AND (".$or.") ORDER BY lname, autoid";
}
if($hids=="")
{
$query_helpers = "SELECT * FROM employee_tbl WHERE job_title='Helper' AND company_id='".$_SESSION['company_id']."' ORDER BY lname, autoid";
}*/
//Temporarily selects all helpers
$query_helpers = "SELECT * FROM employee_tbl WHERE job_title='Helper' AND company_id='".$_SESSION['company_id']."' ORDER BY lname, autoid";
$result_helper = mysql_query($query_helpers) or die("SELECT TROUBLE ".mysql_error());
?>
<html>


<head>
<script type='text/javascript' src='js/select_helper.js'></script>
<link rel="stylesheet" type="text/css" href="css/grid.css" />
</head>

<body onLoad='checkIt()' style="background-color:black">
<!--<div style='width:600px;border-style:solid;'>-->
<div style='width:600px;'><img border="0" src="image/select_helper.png" width="1079" height="28" />
<br />
<table border='0' style='width:550;margin-left:25px;margin-right:25px;'>
<tr>
  <th style='width:120px'>Date</th>
  <th style='width:240px'>Last name</th>
  <th style='width:240px'>First name</th>
</tr>
 <?php
 $str_ids = "";
 while($row_helper = mysql_fetch_array($result_helper))
 {
  $str_ids .= "'".$row_helper["autoid"]."',";
 ?>
 <tr>
  <td><input id='check<?php echo $row_helper["autoid"]?>' value=<?php echo $row_helper["lname"].','.$row_helper["fname"]?> type='checkbox'/><?php echo $row_helper["start_date"]?></td>
  <td><?php echo $row_helper["lname"]?></td>
  <td><?php echo $row_helper["fname"]?></td>
 </tr>
 <?php
 }
 $str_ids = substr($str_ids,0,-1);
 ?>
</table>
<br />
<input type='button' style='background-color:black;color:white;cursor:pointer;margin-left:25px' value='Submit' onClick=pasamo("<?php echo $str_ids ?>") />
<input type='button' style='background-color:black;color:white;cursor:pointer' value='Close' onClick='window.close()'/>
</div>
</body>
</html>